#ifndef __GGEAR_WINDOW_H
#define __GGEAR_WINDOW_H

#include "ggear_types.h"
#include "ggear_size2.h"
#include "ggear_point2.h"
#include "ggear_string.h"

namespace ggear
{
	namespace sys
	{
		class Window
		{
		public:
			//! Construct new window with specified size
			Window(u32 _width, u32 _height);

			//! Destructor
			~Window();

			//! Gets window's device context
			HDC hdc() const;

			//! Gets position of the window's left edge in relation to the desktop
			u32 left() const;

			//! Gets position of the window's top edge in relation to the desktop
			u32 top() const;
				
			//! Gets window's width
			u32 width() const;

			//! Gets window's height
			u32 height() const;

			//! Gets window's title
			glb::String title() const;

			//! Change window's title
			void setTitle(const glb::String& _title);

			//! Change window width
			void setWidth(u32 _width);

			//! Change window height
			void setHeight(u32 _height);

			//! Change window size
			void setSize(u32 _width, u32 _height);

			void setSize(const gfx::Size2u& _size);

			//! Set window position
			void setPosition(u32 _x, u32 _y);

			void setPosition(const gfx::Point2u& _pos);

			//! Open and display the window
			void show() const;

		private:
			//! Handle all of OS messages sent to window
			static LRESULT CALLBACK windowProcess(HWND _hwnd, UINT _msg, WPARAM _wp, LPARAM _lp);

		private:
			glb::String mTitle;
			gfx::Size2u mSize;
			gfx::Point2u mPosition;
			
			HWND mHWnd; 
			HDC mHDC;
		};
	}
}
#endif